var app = getApp()
var wxParse = require("../../../../utils/wxParse.js");

Page({
  data: {
    loading: "../../../images/wx.png",
  },
  onLoad: function(e) {
    var that = this
    if (e.hy_id) {
      var hy_id = e.hy_id
      app.util.request({
        'url': 'entry/wxapp/Xianguanhuiy',
        data: {
          hy_id: hy_id,
          op:'post'
        },
        success: function (res) {
          console.log(res)
          that.setData({
            title: res.data.hy_title,
          })
          wxParse.wxParse('article', 'html', res.data.hy_desc, that, 5);
        },
        fail: function (err) {
          console.log(err)
        },
      })

      that.setData({
          hy_id: hy_id
      })
    }
    if (e.id) {
      var id = e.id
      that.setData({
        id: id
      })
      this.getAllathud()
    }
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
  },
  onShareAppMessage: function() {

  },
  onReady: function() {
   
  },
  getAllathud: function() {
    var that = this
    var id = that.data.id
    app.util.request({
      'url': 'entry/wxapp/Xiangq',
      data: {
        id: id
      },
      success: function(res) {
        console.log(res)
        that.setData({
          title: res.data.data.title,
        })
        wxParse.wxParse('article', 'html', res.data.data.content, that, 5);
      },
      fail: function(err) {
        console.log(err)
      },
    })
  }
});